package com.yaowk.platform.model.page;


import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Record;
import com.yaowk.common.model.Page;

/**
 * @authc yaowk
 * 2017/5/2
 */
public class CompanyPage extends Page {

    private Integer platformId; // 平台id
    private Integer tradeId; // 行业
    private Integer qualificationId; // 性质
    private String name; // 企业名称
    private Integer status; // 状态

    public Integer getPlatformId() {
        return platformId;
    }

    public void setPlatformId(Integer platformId) {
        this.platformId = platformId;
    }

    public Integer getTradeId() {
        return tradeId;
    }

    public void setTradeId(Integer tradeId) {
        this.tradeId = tradeId;
    }

    public Integer getQualificationId() {
        return qualificationId;
    }

    public void setQualificationId(Integer qualificationId) {
        this.qualificationId = qualificationId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public Record toRecord() {
        Record record = new Record()
                .set("platform_id", platformId)
                .set("trade_id", tradeId)
                .set("qualification_id", qualificationId)
                .set("status", status);
        if (StrKit.notBlank(name)) {
            record.set("name", "%" + name + "%");
        }
        return record.removeNullValueColumns();
    }
}
